/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { TreeDataModel, TreeModel } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface BasVendorCls extends TreeModel<BasVendorCls> {
  vcCode?: string; // 分类编码
  vcName?: string; // 分类名称
  vcGrade?: number; // 编码级次
  bvcEnd?: string; // 是否末级
}

export const basVendorClsList = (params?: BasVendorCls | any) =>
  defHttp.get<BasVendorCls>({ url: adminPath + '/bas/ven/cls/list', params });

export const basVendorClsListData = (params?: BasVendorCls | any) =>
  defHttp.post<BasVendorCls[]>({ url: adminPath + '/bas/ven/cls/listData', params });

export const basVendorClsForm = (params?: BasVendorCls | any) =>
  defHttp.get<BasVendorCls>({ url: adminPath + '/bas/ven/cls/form', params });

export const basVendorClsCreateNextNode = (params?: BasVendorCls | any) =>
  defHttp.get<BasVendorCls>({ url: adminPath + '/bas/ven/cls/createNextNode', params });

export const basVendorClsSave = (params?: any, data?: BasVendorCls | any) =>
  defHttp.postJson<BasVendorCls>({ url: adminPath + '/bas/ven/cls/save', params, data });

export const basVendorClsDelete = (params?: BasVendorCls | any) =>
  defHttp.get<BasVendorCls>({ url: adminPath + '/bas/ven/cls/delete', params });

export const basVendorClsTreeData = (params?: any) =>
  defHttp.get<TreeDataModel[]>({ url: adminPath + '/bas/ven/cls/treeData', params });
